FROM php:7.4-fpm

COPY ./sources.list.jessie /etc/apt/sources.list

## Update Ubuntu
RUN apt-get update

## mcrypt
# RUN apt-get install -y libmcrypt-dev
# RUN docker-php-ext-install mcrypt
##ssl
RUN apt install apt-utils -y
RUN apt install dialog -y
RUN apt-get install -y  libssl-dev
RUN docker-php-source extract \
    && cd /usr/src/php/ext/openssl \
    && /usr/local/bin/phpize \
    && ./configure --with-openssl \
    && make \
    && make install \
    && docker-php-source delete
# RUN docker-php-ext-install openssl

## GD
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
RUN docker-php-ext-configure gd 
RUN docker-php-ext-install -j$(nproc) gd

## Intl
RUN apt-get install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl

## General
RUN docker-php-ext-install zip
RUN docker-php-ext-install pcntl
RUN docker-php-ext-install opcache
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mysqli

RUN apt-get install libonig-dev -y
RUN docker-php-ext-install mbstring

# Required by composer
RUN apt-get -y install \
            git \
            zlib1g-dev \
        --no-install-recommends apt-utils

# Install composer
RUN curl -sS https://getcomposer.org/installer \
| php -- --install-dir=/usr/bin/ --filename=composer

# PHP Redis extension
RUN pecl install redis && docker-php-ext-enable redis